package model;

import java.awt.Image;
import java.io.File;

import javax.xml.bind.annotation.XmlElement;

/**
 * This class contains the meta information of a mp3 file.
 * 
 *
 */
public class MP3File {
	
	/*****************************
	 * MEMBER
	 *****************************/
	private String title;
	private String artist;
	private int year;
	private String album;
//	private Path filePath;
	private File mp3File;
	private Image coverImage;
	private ID3Tag id3Tag;
	private int originalTagSize;
	


	/*****************************
	 * CONSTRUCTOR
	 *****************************/
	//gets all the fields as parameter
	public MP3File(String title, String artist, int year, String album,
			File mp3File, Image coverImage) {
		super();
		this.title = title;
		this.artist = artist;
		this.year = year;
		this.album = album;
		this.mp3File = mp3File;
		this.coverImage = coverImage;
	}
	
	//constructor to create testfiles with only title,album,year,artist
	public MP3File(String title, String artist, int year, String album) {
		this(title, artist, year, album, null, null);		
	}
	
	//default
	public MP3File() {
		this("","",0,"");
	}
	/*****************************
	 * GETTER AND SETTER METHODS
	 *****************************/
	@XmlElement(required=true)
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	@XmlElement(required=true)
	public String getArtist() {
		return artist;
	}
	public void setArtist(String artist) {
		this.artist = artist;
	}
	@XmlElement(required=true)
	public int getYear() {
		return year;
	}
	public void setOriginalTagSize(int originalTagSize) {
		this.originalTagSize = originalTagSize;
	}

	public void setYear(int year) {
		this.year = year;
	}
	@XmlElement(required=true)
	public String getAlbum() {
		return album;
	}
	public void setAlbum(String album) {
		this.album = album;
	}
//	public String getFilePath() {
//		return filePath.toString();
//	}
//	public void setFilePath(Path filePath) {
//		this.filePath = filePath;
//	}
	@XmlElement(required=true)
	public File getMp3File() {
		return mp3File;
	}
	public void setMp3File(File mp3File) {
		this.mp3File = mp3File;
	}
	public Image getCoverImage() {
		return coverImage;
	}
	public void setCoverImage(Image coverImage) {
		this.coverImage = coverImage;
	}
	@XmlElement(required=true)
	public ID3Tag getId3Tag() {
		return id3Tag;
	}

	public void setId3Tag(ID3Tag id3Tag) {
		this.id3Tag = id3Tag;
		this.originalTagSize = id3Tag.getSize();
	}
	public int getOriginalTagSize() {
		return this.originalTagSize;
	}
}
